/*
 * Copyright 2011 CyberSMS.ru
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ru.cybersms;

import java.util.Date;
import java.util.TimeZone;
import ru.cybersms.model.response.BalanceResponse;
import ru.cybersms.model.obj.Bulk;
import ru.cybersms.model.response.BulksResponse;
import ru.cybersms.model.obj.Contact;
import ru.cybersms.model.response.ContactsResponse;
import ru.cybersms.model.response.CountResponse;
import ru.cybersms.model.response.HistoryResponse;
import ru.cybersms.model.response.PriceResponse;
import ru.cybersms.model.response.SendResponse;
import ru.cybersms.model.response.StatusResponse;
import ru.cybersms.model.response.IdResponse;
import ru.cybersms.model.obj.Message;
import ru.cybersms.model.response.TagsResponse;
import ru.cybersms.model.obj.Task;
import ru.cybersms.model.response.TasksResponse;

/**
 *
 * @author Андрей Шерцингер <support@cybersms.ru>
 */
public interface CyberSms {

	public final static String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
	public final static String DATE_FORMAT = "yyyy-MM-dd";
	public final static TimeZone TIME_ZONE_UTC = TimeZone.getTimeZone("UTC");

	public BalanceResponse checkBalance() throws Exception;

	public SendResponse sendSms(Message message, Boolean test) throws Exception;
	public StatusResponse getStatus(Integer[] message_id) throws Exception;
	public PriceResponse getPrice(Message message) throws Exception;
	public HistoryResponse getHistory(Integer[] message_id, String recipient, String sender, String status, Date date_from, Date date_to, Integer bulk_id) throws Exception;

	public IdResponse createTag(String name) throws Exception;
	public IdResponse updateTag(int tag_id, String name) throws Exception;
	public CountResponse deleteTag(Integer[] tag_id) throws Exception;
	public TagsResponse listTag(Integer[] tag_id) throws Exception;

	public IdResponse createContact(Contact contact) throws Exception;
	public IdResponse updateContact(Contact contact) throws Exception;
	public CountResponse deleteContact(Integer[] contact_id, String[] phone) throws Exception;
	public ContactsResponse listContact(Integer[] contact_id, Integer[] tag_id, String[] phone) throws Exception;

	public IdResponse createBulk(Bulk bulk) throws Exception;
	public IdResponse updateBulk(Bulk bulk) throws Exception;
	public CountResponse deleteBulk(Integer[] bulk_id) throws Exception;
	public IdResponse sendBulk(int bulk_id) throws Exception;
	public IdResponse resumeBulk(int bulk_id) throws Exception;
	public BulksResponse listBulk(Integer[] bulk_id, String name, String sender, String status, Date date_from, Date date_to) throws Exception;
	
	public IdResponse createTask(Task task) throws Exception;
	public IdResponse updateTask(Task task) throws Exception;
	public CountResponse deleteTask(Integer[] task_id) throws Exception;
	public TasksResponse listTask(Integer[] task_id, Integer type, Boolean active, Integer repeat, String recipient, String sender) throws Exception;
}
